"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const _hoisted_1 = { class: "me-bubble-duration" };
const _hoisted_2 = { class: "me-bubble-duration-text" };
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "duration",
  props: {
    done: { type: Boolean, default: true }
  },
  setup(__props) {
    const props = __props;
    let timerId = null;
    const duration = vue.ref(0);
    vue.watchEffect(() => {
      if (!props.done) {
        duration.value = 0;
        timerId = setInterval(() => {
          duration.value++;
          if (props.done) {
            clearInterval(timerId);
            timerId = null;
          }
        }, 1e3);
      } else {
        clearInterval(timerId);
        timerId = null;
      }
    });
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
        vue.createElementVNode("span", _hoisted_2, vue.toDisplayString(duration.value) + "s", 1)
      ]);
    };
  }
});
exports.default = _sfc_main;
//# sourceMappingURL=duration.vue2.cjs.map
